<?php

namespace App\HttpController\Admin;

use App\HttpController\Base;
use App\Model\Service\CustomerCartService;

class CustomerCart extends Base
{
    public function list(){
        $data = $this->service->list();
        $this->success($data);
    }

    protected function getValidate(string $actionName): array
    {
        switch ($actionName) {
            case 'view':
                return [
                    'cart_id' => 'required,integer,notEmpty',
                ];
            case 'list':
            default:
                return [
                    'needPage' => 'required,notEmpty,integer',
                    'api_come' => 'required,notEmpty',
                    'cus_id' => 'required,integer,notEmpty',
                ];
        }
    }

    protected function initService(array $postParams, array $loginUser): void
    {
        $this->service = new CustomerCartService($postParams,$loginUser);
    }
}